package com.bwie.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bwie.pojo.TbDict;
import com.bwie.service.TbDictService;
import com.bwie.mapper.TbDictMapper;
import com.bwie.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
* @author 牛y
* @description 针对表【tb_dict(字典表)】的数据库操作Service实现
* @createDate 2025-07-19 10:09:51
*/
@Service
public class TbDictServiceImpl extends ServiceImpl<TbDictMapper, TbDict>
    implements TbDictService{

    @Autowired
    TbDictMapper tbDictMapper;

    @Override
    public R getDictList(Integer dictType) {
        List<TbDict> tbDicts = tbDictMapper.selectList(new QueryWrapper<TbDict>().lambda().eq(TbDict::getDictType, dictType));
        if(tbDicts==null){
            return R.ERROR(500,"字典表类型不存在");
        }
        return R.OK(tbDicts);
    }

}




